import * as types from './mutation-types'

const mutations = {
    // 保存当前歌曲的状播放状态
    [types.SET_PLAYSTATUS] (state, val = false) {
        state.isPlayed = val
    },
    // 将播放列表存起来
    [types.SET_PLAYLIST] (state, val = null) {
        state.playList = val
        // 将播放列表存储到硬盘
        window.localStorage.setItem('playList', JSON.stringify(val))
    },
    [types.SET_PLAYINDEX] (state, val = 0) {
        state.playIndex = val
        // 将当前歌曲的索引进行存储,存储到硬盘
        window.localStorage.setItem('playIndex', val)
    },
    // 设置提示
    setPlayListTips (state, val = null) {
        state.playListTips = val
    }
}
export default mutations
